﻿using System.ServiceModel;
using System.ServiceModel.Web;
using UFIDA.U9.WSS.ProxyService.Models;

namespace UFIDA.U9.WSS.DebugService.Interfaces
{
    /// <summary>
    ///     调试服务
    /// </summary>
    [ServiceContract]
    internal interface IDebugService
    {
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> TestConnection();

        #region 事务调试

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> IsTransactionDebugging(int debugType, string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> SetupTransactionDebug(int debugType, string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> StopTransactionDebug(int debugType, string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> StopAllTransactionDebug();

        #endregion

        #region 代理调试

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> IsProxyDoDebugging(string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> SetupProxyDoDebug(string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> StopProxyDoDebug(string proxyType);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<bool> StopAllProxyDoDebug();

        #endregion
    }
}